package edu.cuny.baruch.cis9590.library.entities;

import java.util.Date;

import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.Id;
import javax.persistence.Table;

import org.hibernate.annotations.GenericGenerator;

@Entity
@Table(name="borrows")
public final class Borrow {

    private int id;
    private int bookId;
    private int patronId;
    private Date borrowDate;
    private Date dueDate;
    
    public Borrow() {
    }
    
    public Borrow(int bookId, int patronId, Date borrowDate, Date dueDate) {
        this.bookId = bookId;
        this.patronId = patronId;
        this.borrowDate = borrowDate;
        this.dueDate = dueDate;
    }
    
    @Id
    @Column(name="Reservation_ID")
    @GeneratedValue(generator="increment")
    @GenericGenerator(name="increment", strategy="increment")
    public int getId() {
        return id;
    }
    
    @Column(name="book_id")
    public int getBookId() {
        return bookId;
    }
    
    @Column(name="patron_id")
    public int getPatronId() {
        return patronId;
    }
    
    @Column(name="borrow_date")
    public Date getBorrowDate() {
        return borrowDate;
    }
    
    @Column(name="due_date")
    public Date getDueDate() {
        return dueDate;
    }


    public void setBookId(int bookId) {
        this.bookId = bookId;
    }

    public void setPatronId(int patronId) {
        this.patronId = patronId;
    }

    public void setBorrowDate(Date borrowDate) {
        this.borrowDate = borrowDate;
    }

    public void setDueDate(Date dueDate) {
        this.dueDate = dueDate;
    }

	public void setId(int id) {
		this.id = id;
	}
}
